package com.taoym.voucher.xcx.controller;

import com.taoym.voucher.common.response.Response;
import com.taoym.voucher.xcx.entity.dto.XcxGetActivityOrdersDTO;
import com.taoym.voucher.xcx.entity.vo.XcxGetOrderVO;
import com.taoym.voucher.xcx.service.XcxActivityOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @coder taoym
 * @datetime 2021/6/11 21:12
 * @desc 订单信息
 */
@Api(tags = "订单信息控制器")
@RestController
@RequestMapping("/order")
@Validated
public class XcxActivityOrderController {

    @Autowired
    private XcxActivityOrderService xcxActivityOrderService;

    @ApiOperation("团长的订单信息")
    @GetMapping("/list/chief")
    public Response<List<XcxGetOrderVO>> listActivityOrders(@Valid XcxGetActivityOrdersDTO data) {
        return Response.success(xcxActivityOrderService.getOrderList(data));
    }
}
